# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2024/10/19
desc: 
sample: 
"""
import requests

host = 'http://121.11.97.201:9088/pinter/bank'

def login():
    url = host+'/api/login2'
    params = {'userName':'admin',
              'password':'1234'}
    resp = requests.post(url=url,data=params)
    assert resp.status_code==200
    assert resp.json().get('code')=='0'
    #处理数据
    return  resp.json().get('data')


def query(token):
    url = host + '/api/query2'
    params = {'userName':'admin'}
    #问开发
    headers = {'testfan-token':token}
    resp = requests.get(url=url, params=params,headers=headers)
    assert resp.status_code==200
    assert resp.json().get('code')=='0'

token = login()
query(token)
#...
#...